using System.Collections.Generic;
using System.ComponentModel.Composition;
using MediaAssistant.DAL;
using MediaAssistant.DAL.Constants;

namespace MediaAssistant.Management
{
    [Export]
    public class MusicTagFileSynchronizer : MusicTagSynchronizer
    {
        public MusicTagFileSynchronizer()
        {
            Name = "Music Tag File Synchronizer";
        }
        protected override IEnumerable<Music> GetMusicToSync()
        {
            return DatabaseManager.Instance.GetMusicWithInvalidFile();
        }
        protected override void SyncTag(Music music)
        {
            if(music.TagStatus==TagStatus.InvalidFile)
                DatabaseManager.Instance.UpdateFileTagAndLink(music);
        }
    }
}